package com.youzan.cloud.biz.integral.common;

import lombok.Data;


/**
 * @author hlin
 */
@Data
public abstract class UserCommand {

    protected String id;
    protected ExecStatus status;
    protected boolean isAsync = false;
    protected Object result;

    public enum ExecStatus {
        /**
         * 创建
         */
        CREATED(0),
        /**
         * 执行中
         */
        EXECUTING(1),
        /**
         * 已完成
         */
        DONE(2),
        /**
         * 执行失败
         */
        FAILED(-1);

        private int code;

        ExecStatus(int code) {
            this.code = code;
        }
    }
}
